import { defineStore } from 'pinia'
import { getAllRoleList } from '@/api/sys/role'

const useRoleStore = defineStore('RoleStore', {
  state: () => ({
    wxList: [],
    manageList: [],
  }),
  actions: {
    getRole() {
      // this.getWxRole()
      this.getManageRole()
    },
    getWxRole() {
      getAllRoleList({ type: '1' }).then(({ data }) => {
        this.wxList = data.data
      })
    },
    getManageRole() {
      getAllRoleList({ type: '2' }).then(({ data }) => {
        this.manageList = data.data
      })
    },
    reset() {
      this.wxList = []
      this.manageList = []
    },
  },
  getters: {},
})

export default useRoleStore
